Computers / Programming / Projects / Altair 8800 / HexDump / Test Programs

These programs were used to test the various subroutines of the HexDump program.

Note that these programs were hand-assembled so the syntax may not be correct. They were entered into the computer using the monitor ROM which is why they use octal values.

PrintChar Test

PrintCharTest
PrintChar Test

PrintCharTest.asm

asm type icon
Type: Program
Language: 8080 Assembly
PrintCharTest.asm

Like all the tests this one starts by initializing the stack pointer and the 2SIO board. It then initializes the accumulator to 0, Calls PrintChar to print the character currently in the accumulator, and then increments the accumulator. Finally the program jumps back to the PrintChar call to print the next character. The program loops forever printing all possible characters. This verifies that PrintChar is properly printing characters.

PrintStr Test

PrintStrTest
PrintStr Test

PrintStrTest.asm

asm type icon
Type: Program
Language: 8080 Assembly
PrintStrTest.asm

The programs tests PrintStrZ by calling it 4 times. Once for each of the strings used by the HexDump program. This verifies that both PrintStrZ is working properly and that the strings have been entered correctly.

PrintHex4 Test

PrintHex4Test
PrintHex4 Test

PrintHex4Test.asm

asm type icon
Type: Program
Language: 8080 Assembly
PrintHex4Test.asm

This program starts by initializing the C Register to 0. It then copies the C register to the accumulator, calls PrintHex4 to print the value of the low-order bits in the accumulator and then increments the C register. Finally the program jumps back to point where the C register is copied to the accumulator. The program loops forever printing all possible hex digits. This verifies that PrintHex4 is properly decoding values and printing digits. The C register is used because the PrintHex4 doesn't preserve the value in the accumulator. After calling PrintHex4 the accumulator will contain the ASCII value of the digit printed.

PrintHex8 Test

PrintHex8Test
PrintHex8 Test

PrintHex8Test.asm

asm type icon
Type: Program
Language: 8080 Assembly
PrintHex8Test.asm

This program starts by initializing the Accumulator to 0. It then calls PrintHex8 to print the value of the accumulator and then increments the Accumulator register. Finally the program jumps back to the PrintHex8 call to print the next value. The program loops forever printing all possible two-digit hex values. This verifies that PrintHex8 is properly decoding and printing values. The C register doesn't need to be used here because PrintHex8 does preserve the accumulator.

ReadHex4 Test

ReadHex4Test
ReadHex4 Test

ReadHex4Test.asm

asm type icon
Type: Program
Language: 8080 Assembly
ReadHex4Test.asm

This program starts by calling ReadHex4 and then calls PrintHex4 before jumping back to the ReadHex4 call. The ReadHex4 subroutine will wait until a valid hex digit has been entered. The first value displayed in the output is from ReadHex4 echoing the character entered and the second value is from PrintHex4. The values are easiest to differentiate when using lowercase letter digits as PrintHex4 always prints in uppercase while ReadHex4 prints in upper and lower case depending on what the user entered. This verifies that ReadHex4 is reading the character and correctly determining the value entered.

ReadHex8 Test

ReadHex8Test
ReadHex8 Test

ReadHex8Test.asm

asm type icon
Type: Program
Language: 8080 Assembly
ReadHex8Test.asm

This program starts by calling ReadHex8, it then copies the E register to the accumulator and calls PrintHex8 before jumping back to the ReadHex8 call. The E register is copied to the accumulator because ReadHex8 returns its result in the E register while PrintHex8 expects its input in the accumulator. The first two values displayed are from ReadHex8 echoing the characters entered and the next two are from PrintHex8. This verifies that ReadHex8 is reading the characters and correctly determining the value entered.

ReadHex16 Test

ReadHex16Test
ReadHex16 Test

ReadHex16Test.asm

asm type icon
Type: Program
Language: 8080 Assembly
ReadHex16Test.asm

This program starts by calling ReadHex16. it then copies the D register to the accumulator, calls PrintHex8, copies the E register to the accumulator, and calls PrintHex8 again before jumping back to the ReadHex16 call. The ReadHex16 call returns the high-order byte read in the D register and the low-order byte in the E register which is why they need to be copied to the accumulator before being printed. The first four values displayed are from ReadHex16 echoing the characters entered and the next four values are from the two calls to PrintHex8. This verifies that ReadHex16 is reading the characters and determining the value correctly.